import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:geomancy/styles/index.dart';

class CommonTitleWidget extends StatelessWidget {
  final String txt;
  final double? fontSize;
  const CommonTitleWidget({super.key, required this.txt, this.fontSize});

  @override
  Widget build(BuildContext context) {
    return Align(
      child: Container(
        width: 510.w,
        height: 80.w,
        alignment: Alignment.center,
        decoration: BoxDecoration(
          color: ColorStyle.themeColor,
          borderRadius: BorderRadius.all(Radius.circular(40.w)),
          border: Border.all(
            width: 5.w,
            color: ColorStyle.borderColor
          )
        ),
        child: Stack(
          children: [
            Text(txt, style: TextStyle(
              fontSize: fontSize ?? 30.sp,
              letterSpacing: 1.2,
              foreground: Paint()
                ..style = PaintingStyle.stroke
                ..strokeWidth = 4.w
                ..color = ColorStyle.borderColor,
            )),
            Text(txt, style: TextStyle(fontSize: fontSize ?? 30.sp, letterSpacing: 1.2, color: ColorStyle.titleColor))
          ],
        ),
      ),
    );
  }
}
